package com.zkc.springbootnew.service.impl;

import com.zkc.springbootnew.bean.Contact_user;
import com.zkc.springbootnew.dao.Contact_userMapper;
import com.zkc.springbootnew.service.userservice;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class userserviceimpl implements userservice{


    @Resource
    Contact_userMapper contactUserMapper;

    @Override
    public List<Contact_user> userAll() throws Exception{
        return contactUserMapper.selectByExample(null);
    }

    @Override
    public Contact_user usersingle(Integer id) throws Exception {
        return contactUserMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer usermodify(Contact_user contact_user) throws Exception {
        return contactUserMapper.updateByPrimaryKeySelective(contact_user);
    }

    @Override
    public Integer userdelete(Integer xid) throws Exception {
        return contactUserMapper.deleteByPrimaryKey(xid);
    }

    @Override
    public Integer UserAdd(Contact_user contact_user) throws Exception {
        return contactUserMapper.insertSelective(contact_user);
    }

    @Override
    public Contact_user UserLogin(String contactalias) throws Exception {
        return contactUserMapper.selectByPrimaryKeys(contactalias);
    }

}
